<!DOCTYPE html>
<html>
<head>
    <title>节流</title>
    <script src="../../src/function/throttle.js"></script>
    <style>
        body {
            height: 2000px;
            background: linear-gradient(#125, #eae)
        }
    </style>
</head>
<body>
    <script>
        // window.addEventListener('scroll', function() {
        //     console.log(Date.now())
        // });

        window.addEventListener('scroll', throttle(function() {
            console.log(Date.now())
        }, 1000));
    </script>
</body>
</html>